package com.ZengQi.event.service.impl;

import com.ZengQi.event.dao.UserDao;
import com.ZengQi.event.dao.impl.UserDaoImpl;
import com.ZengQi.event.entity.User;
import com.ZengQi.event.service.UserService;

public class UserServiceImpl implements UserService {
    private final UserDao userDao=new UserDaoImpl();
    @Override
    public boolean saveUser(User user) {
        return userDao.insertUser(user);
    }

    @Override
    public User findUser(User conditionUser) {
        return userDao.getUser(conditionUser);
    }

    @Override
    public boolean modifyUserByLoginName(User user, String oldUserName) {
        return userDao.updateUserByUserName(user,oldUserName);
    }

    @Override
    public boolean findIsExistUserName(User conditionUser) {
        return userDao.getIsExistByUserName(conditionUser);
    }

    @Override
    public User findUserByUserName(User conditionUser) {
        return userDao.getUserByUserName(conditionUser);
    }
}
